// BIN2HEX GENEATED FILE
// 8x8 raster font for debug output

#include "font8x8.h"
#include <string.h>

BYTE font8x8[]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x1c,0x18,0x18,0x00,0x18,0x18,0x00,
0x36,0x36,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x7f,0x36,0x7f,0x36,0x00,
0x00,0x0c,0x3e,0x0f,0x1e,0x3c,0x1f,0x0c,0x00,0x63,0x33,0x18,0x0c,0x66,0x63,0x00,
0x06,0x0b,0x06,0x0f,0x5b,0x33,0x5e,0x00,0x18,0x18,0x0c,0x00,0x00,0x00,0x00,0x00,
0x18,0x0c,0x06,0x06,0x06,0x0c,0x18,0x00,0x0c,0x18,0x30,0x30,0x30,0x18,0x0c,0x00,
0x00,0x00,0x2a,0x1c,0x3e,0x1c,0x2a,0x00,0x00,0x00,0x08,0x08,0x3e,0x08,0x08,0x00,
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x0c,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x60,0x30,0x18,0x0c,0x06,0x03,0x00,
0x1c,0x36,0x73,0x6b,0x67,0x36,0x1c,0x00,0x10,0x18,0x1c,0x18,0x18,0x18,0x3c,0x00,
0x3c,0x66,0x60,0x38,0x0c,0x66,0x7e,0x00,0x3c,0x66,0x60,0x30,0x60,0x66,0x3c,0x00,
0x30,0x38,0x3c,0x36,0x7e,0x30,0x30,0x00,0x7e,0x06,0x3e,0x60,0x60,0x66,0x3c,0x00,
0x38,0x0c,0x06,0x3e,0x66,0x66,0x3c,0x00,0x7e,0x60,0x60,0x30,0x18,0x18,0x18,0x00,
0x3c,0x66,0x3c,0x66,0x66,0x66,0x3c,0x00,0x3c,0x66,0x66,0x7c,0x60,0x60,0x3e,0x00,
0x00,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x0c,0x00,
0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x00,0x00,0x00,0x00,0x3e,0x00,0x3e,0x00,0x00,
0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x00,0x3c,0x66,0x30,0x18,0x18,0x00,0x18,0x18,
0x3c,0x42,0x59,0x55,0x2d,0x01,0x7e,0x00,0x07,0x0f,0x1b,0x33,0x7f,0x63,0x77,0x00,
0x1f,0x33,0x63,0x3f,0x63,0x63,0x3f,0x00,0x3c,0x66,0x03,0x03,0x03,0x63,0x3e,0x00,
0x1f,0x36,0x66,0x66,0x66,0x36,0x1f,0x00,0x1e,0x33,0x03,0x06,0x03,0x63,0x3e,0x00,
0x7f,0x63,0x03,0x1f,0x03,0x03,0x07,0x00,0x3c,0x66,0x03,0x7b,0x63,0x7e,0x61,0x3f,
0x77,0x36,0x36,0x3e,0x36,0x36,0x77,0x00,0x3c,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,
0x70,0x60,0x60,0x60,0x67,0x63,0x3e,0x00,0x63,0x33,0x1b,0x0f,0x1b,0x33,0x67,0x00,
0x07,0x03,0x03,0x03,0x03,0x63,0x7f,0x00,0x63,0x77,0x7f,0x6b,0x63,0x63,0x63,0x00,
0x73,0x67,0x6f,0x7b,0x73,0x63,0x67,0x00,0x3c,0x66,0x63,0x63,0x63,0x63,0x3e,0x00,
0x3f,0x63,0x63,0x3f,0x03,0x03,0x07,0x00,0x3c,0x66,0x63,0x63,0x63,0x7b,0x3e,0x60,
0x3f,0x63,0x63,0x3f,0x1b,0x33,0x67,0x00,0x3c,0x66,0x03,0x3e,0x60,0x61,0x3f,0x00,
0x7f,0x6d,0x0c,0x0c,0x0c,0x0c,0x1e,0x00,0x36,0x63,0x63,0x63,0x63,0x63,0x3e,0x00,
0x63,0x63,0x63,0x63,0x36,0x1c,0x08,0x00,0x63,0x63,0x63,0x6b,0x7f,0x77,0x63,0x00,
0x63,0x63,0x36,0x1c,0x36,0x63,0x63,0x00,0x63,0x63,0x63,0x3e,0x0c,0x0c,0x0c,0x00,
0x7f,0x63,0x30,0x18,0x0c,0x66,0x7f,0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,
0x00,0x03,0x06,0x0c,0x18,0x30,0x60,0x00,0x3c,0x30,0x30,0x30,0x30,0x30,0x3c,0x00,
0x00,0x0c,0x1e,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x60,0x7e,0x63,0x7e,0x00,
0x03,0x03,0x3f,0x67,0x63,0x63,0x3f,0x00,0x00,0x00,0x3e,0x63,0x03,0x63,0x3e,0x00,
0x60,0x60,0x7e,0x73,0x63,0x63,0x7e,0x00,0x00,0x00,0x3e,0x63,0x3f,0x03,0x3e,0x00,
0x38,0x6c,0x0c,0x1e,0x0c,0x0c,0x0c,0x00,0x00,0x00,0x3e,0x63,0x63,0x7e,0x60,0x3e,
0x03,0x03,0x3b,0x6f,0x63,0x63,0x63,0x00,0x18,0x18,0x00,0x1c,0x18,0x18,0x18,0x00,
0x18,0x18,0x00,0x1c,0x18,0x18,0x1b,0x0e,0x03,0x03,0x3b,0x37,0x1f,0x1b,0x33,0x00,
0x0c,0x18,0x18,0x18,0x18,0x18,0x30,0x00,0x00,0x00,0x63,0x77,0x7f,0x6b,0x63,0x00,
0x00,0x00,0x3b,0x6f,0x63,0x63,0x63,0x00,0x00,0x00,0x3e,0x63,0x63,0x63,0x3e,0x00,
0x00,0x00,0x3b,0x66,0x66,0x3e,0x06,0x0f,0x00,0x00,0x6e,0x33,0x33,0x3e,0x30,0x78,
0x00,0x00,0x3b,0x6e,0x06,0x06,0x0f,0x00,0x00,0x00,0x3c,0x02,0x3c,0x60,0x3e,0x00,
0x00,0x08,0x0c,0x3e,0x0c,0x2c,0x18,0x00,0x00,0x00,0x66,0x63,0x63,0x73,0x5e,0x00,
0x00,0x00,0x63,0x63,0x63,0x36,0x1c,0x00,0x00,0x00,0x63,0x6b,0x7f,0x77,0x63,0x00,
0x00,0x00,0x63,0x36,0x1c,0x36,0x63,0x00,0x00,0x00,0x66,0x63,0x63,0x7e,0x60,0x3e,
0x00,0x00,0x7f,0x30,0x1c,0x06,0x7f,0x00,0x38,0x0c,0x0c,0x06,0x0c,0x0c,0x38,0x00,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1c,0x30,0x30,0x60,0x30,0x30,0x1c,0x00,
0x2c,0x1a,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};


void PrintCharDX(BYTE ch,BYTE* Y,int line_size,BYTE val)
{
	BYTE* fnt=font8x8+((int)ch)*8;//8 bytes per symbol
	int i;
	for (i=0;i<8;i++) {
		int c=fnt[i];
		if (c&0x80) Y[7]=val;
		if (c&0x40) Y[6]=val;
		if (c&0x20) Y[5]=val;
		if (c&0x10) Y[4]=val;
		if (c&0x08) Y[3]=val;
		if (c&0x04) Y[2]=val;
		if (c&0x02) Y[1]=val;
		if (c&0x01) Y[0]=val;
		Y+=line_size;
	}
}

void PrintLineDX(const char* str,BYTE* Y,int x,int y,int line_size)
{
	Y+=x+y*line_size;
	while (*str) {
		PrintCharDX(*str,Y,line_size,0x0);
		PrintCharDX(*str++,Y-line_size-1,line_size,0xFF);
		Y+=9;
	}
}

void PrintLineDXBack(const char* str,BYTE* Y,int x,int y,int line_size)
{
	int i;
	int len = strlen(str);
	Y+=x+y*line_size;
	str += len-1;
	for(i = 0; i < len ; i++) {
		PrintCharDX(*str,Y,line_size,0x0);
		PrintCharDX(*str--,Y-line_size-1,line_size,0xFF);
		Y-=9;
	}
}

